<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    [v-cloak] {
      display: none;
    }
  </style>
</head>

<body>
  <div id="app">
    <div v-cloak>{{xing}}</div>
    <div v-cloak>{{zuo}}</div>
    <button @click='str'>作者</button>
    <!--
      事件绑定 指令v-on:事件名称='事件处理程序' 也可以简写@事件名称='事件处理程序'
      借用了前面的知识点，做了个小东西
    -->
    <button v-on:click='handle'>隐藏</button>
    <button @click='xiang'>显示</button>
  </div>
  <script src="../vue.js"></script>
  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        xing: '我们的纪念',
        zuo: ''
      },
      methods: {
        handle() {
          this.xing = '',
            this.zuo = ''

        },
        str() {
          this.zuo = '李雅微'
        },
        xiang() {
          this.xing = '我们的纪念',
            this.zuo = '李雅微'
        }
      }
    })
  </script>
</body>

</html>